// Based on: https://github.com/angular/angular/blob/15a825c113701583773fa028259518b63760c3b4/devtools/styles.scss

@use 'sass:map';
@use 'external/npm/node_modules/@angular/material/index' as mat;

// Normalize as it's expected by Angular:
// https://github.com/angular/components/issues/12133
@import 'normalize';

$_palettes: (
  primary: (
    0: #000000,
    10: #001e31,
    20: #00317b,
    25: #003f9c,
    30: #004cbe,
    35: #0052ce,
    40: #0064ff,
    50: #0077ff,
    60: #008cff,
    70: #009cff,
    80: #87d0ff,
    90: #b9e1ff,
    95: #e7f2ff,
    98: #f7f9ff,
    99: #fcfcff,
    100: #ffffff,
  ),
  secondary: (
    0: #000000,
    10: #171a2c,
    20: #2c2f42,
    25: #373a4d,
    30: #434659,
    35: #4e5165,
    40: #5a5d72,
    50: #73768b,
    60: #8d8fa6,
    70: #a7aac1,
    80: #c3c5dd,
    90: #dfe1f9,
    95: #f0efff,
    98: #fbf8ff,
    99: #fefbff,
    100: #ffffff,
  ),
  tertiary: (
    0: #000000,
    10: #00201c,
    20: #003731,
    25: #00443c,
    30: #005048,
    35: #005d53,
    40: #01796b,
    50: #008678,
    60: #00a392,
    70: #2dbfad,
    80: #54dbc8,
    90: #74f8e4,
    95: #b4fff1,
    98: #e5fff8,
    99: #f2fffb,
    100: #ffffff,
  ),
  neutral: (
    0: #000000,
    10: #1b1b1f,
    20: #303034,
    25: #3b3b3f,
    30: #47464a,
    35: #535256,
    40: #5f5e62,
    50: #78767a,
    60: #919094,
    70: #acaaaf,
    80: #c8c6ca,
    90: #e4e1e6,
    95: #f3f0f4,
    98: #fbf8fd,
    99: #fefbff,
    100: #ffffff,
    4: #0e0e11,
    6: #131316,
    12: #1f1f23,
    17: #2a2a2d,
    22: #353438,
    24: #39393c,
    87: #dcd9de,
    92: #eae7ec,
    94: #f0edf1,
    96: #f5f2f7,
  ),
  neutral-variant: (
    0: #000000,
    10: #1a1b23,
    20: #2f3038,
    25: #3a3b43,
    30: #46464f,
    35: #51525b,
    40: #5d5e67,
    50: #767680,
    60: #90909a,
    70: #abaab4,
    80: #c6c5d0,
    90: #e3e1ec,
    95: #f1effa,
    98: #fbf8ff,
    99: #fefbff,
    100: #ffffff,
  ),
  error: (
    0: #000000,
    10: #410002,
    20: #690005,
    25: #7e0007,
    30: #93000a,
    35: #a80710,
    40: #ba1a1a,
    50: #de3730,
    60: #ff5449,
    70: #ff897d,
    80: #ffb4ab,
    90: #ffdad6,
    95: #ffedea,
    98: #fff8f7,
    99: #fffbff,
    100: #ffffff,
  ),
);

$_rest: (
  secondary: map.get($_palettes, secondary),
  neutral: map.get($_palettes, neutral),
  neutral-variant: map.get($_palettes, neutral-variant),
  error: map.get($_palettes, error),
);
$_primary: map.merge(map.get($_palettes, primary), $_rest);
$_tertiary: map.merge(map.get($_palettes, tertiary), $_rest);

$primary: $_primary;
$tertiary: $_tertiary;

$light-theme: mat.define-theme(
  (
    color: (
      theme-type: light,
      primary: $_primary,
      tertiary: $_tertiary,
    ),
  )
);
$dark-theme: mat.define-theme(
  (
    color: (
      theme-type: dark,
      primary: $_primary,
      tertiary: $_tertiary,
    ),
  )
);

@include mat.all-component-typographies();
@include mat.core();

body {
  @include mat.all-component-themes($light-theme);
  @include mat.color-variants-backwards-compatibility($light-theme);
}

html,
body {
  --default-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
    'Segoe UI Symbol';
  padding: 0;
  margin: 0;
  height: 100%;
  // Use system font.
  font-family: var(--default-font-family);
  -webkit-font-smoothing: antialiased;
}

* {
  box-sizing: border-box;
}

// Need these as global styles since markdown HTML is rendered specially.
.markdown * {
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (pointer: fine) {
  @supports not (selector(::-webkit-scrollbar)) {
    * {
      scrollbar-color: #dadce0 transparent;
      scrollbar-gutter: auto;
      scrollbar-width: thin;
    }
  }

  ::-webkit-scrollbar,
  ::-webkit-scrollbar-corner {
    background: transparent;
    height: 12px;
    width: 12px;
  }

  ::-webkit-scrollbar-thumb {
    background: content-box currentColor;
    border: 2px solid transparent;
    border-radius: 8px;
    color: #dadce0;
    min-height: 48px;
    min-width: 48px;
  }

  :hover::-webkit-scrollbar-thumb {
    color: #80868b;
  }

  ::-webkit-scrollbar-thumb:active {
    color: #5f6368;
  }

  ::-webkit-scrollbar-button {
    height: 0;
    width: 0;
  }
}

// Make it so wide code examples do not overflow. Instead show a horizontal scrollbar.
mesop-markdown pre {
  overflow-x: scroll;
}

// Generated with pygments
// pygmentize -S xcode -f html -a .highlight > style.css
pre {
  line-height: 125%;
}
td.linenos .normal {
  color: inherit;
  background-color: transparent;
  padding-left: 5px;
  padding-right: 5px;
}
span.linenos {
  color: inherit;
  background-color: transparent;
  padding-left: 5px;
  padding-right: 5px;
}
td.linenos .special {
  color: #000000;
  background-color: #ffffc0;
  padding-left: 5px;
  padding-right: 5px;
}
span.linenos.special {
  color: #000000;
  background-color: #ffffc0;
  padding-left: 5px;
  padding-right: 5px;
}
.highlight .hll {
  background-color: #ffffcc;
}
.highlight {
  background: #ffffff;
}
.highlight .c {
  color: #177500;
} /* Comment */
.highlight .err {
  color: #000000;
} /* Error */
.highlight .k {
  color: #a90d91;
} /* Keyword */
.highlight .l {
  color: #1c01ce;
} /* Literal */
.highlight .n {
  color: #000000;
} /* Name */
.highlight .o {
  color: #000000;
} /* Operator */
.highlight .ch {
  color: #177500;
} /* Comment.Hashbang */
.highlight .cm {
  color: #177500;
} /* Comment.Multiline */
.highlight .cp {
  color: #633820;
} /* Comment.Preproc */
.highlight .cpf {
  color: #177500;
} /* Comment.PreprocFile */
.highlight .c1 {
  color: #177500;
} /* Comment.Single */
.highlight .cs {
  color: #177500;
} /* Comment.Special */
.highlight .kc {
  color: #a90d91;
} /* Keyword.Constant */
.highlight .kd {
  color: #a90d91;
} /* Keyword.Declaration */
.highlight .kn {
  color: #a90d91;
} /* Keyword.Namespace */
.highlight .kp {
  color: #a90d91;
} /* Keyword.Pseudo */
.highlight .kr {
  color: #a90d91;
} /* Keyword.Reserved */
.highlight .kt {
  color: #a90d91;
} /* Keyword.Type */
.highlight .ld {
  color: #1c01ce;
} /* Literal.Date */
.highlight .m {
  color: #1c01ce;
} /* Literal.Number */
.highlight .s {
  color: #c41a16;
} /* Literal.String */
.highlight .na {
  color: #836c28;
} /* Name.Attribute */
.highlight .nb {
  color: #a90d91;
} /* Name.Builtin */
.highlight .nc {
  color: #3f6e75;
} /* Name.Class */
.highlight .no {
  color: #000000;
} /* Name.Constant */
.highlight .nd {
  color: #000000;
} /* Name.Decorator */
.highlight .ni {
  color: #000000;
} /* Name.Entity */
.highlight .ne {
  color: #000000;
} /* Name.Exception */
.highlight .nf {
  color: #000000;
} /* Name.Function */
.highlight .nl {
  color: #000000;
} /* Name.Label */
.highlight .nn {
  color: #000000;
} /* Name.Namespace */
.highlight .nx {
  color: #000000;
} /* Name.Other */
.highlight .py {
  color: #000000;
} /* Name.Property */
.highlight .nt {
  color: #000000;
} /* Name.Tag */
.highlight .nv {
  color: #000000;
} /* Name.Variable */
.highlight .ow {
  color: #000000;
} /* Operator.Word */
.highlight .mb {
  color: #1c01ce;
} /* Literal.Number.Bin */
.highlight .mf {
  color: #1c01ce;
} /* Literal.Number.Float */
.highlight .mh {
  color: #1c01ce;
} /* Literal.Number.Hex */
.highlight .mi {
  color: #1c01ce;
} /* Literal.Number.Integer */
.highlight .mo {
  color: #1c01ce;
} /* Literal.Number.Oct */
.highlight .sa {
  color: #c41a16;
} /* Literal.String.Affix */
.highlight .sb {
  color: #c41a16;
} /* Literal.String.Backtick */
.highlight .sc {
  color: #2300ce;
} /* Literal.String.Char */
.highlight .dl {
  color: #c41a16;
} /* Literal.String.Delimiter */
.highlight .sd {
  color: #c41a16;
} /* Literal.String.Doc */
.highlight .s2 {
  color: #c41a16;
} /* Literal.String.Double */
.highlight .se {
  color: #c41a16;
} /* Literal.String.Escape */
.highlight .sh {
  color: #c41a16;
} /* Literal.String.Heredoc */
.highlight .si {
  color: #c41a16;
} /* Literal.String.Interpol */
.highlight .sx {
  color: #c41a16;
} /* Literal.String.Other */
.highlight .sr {
  color: #c41a16;
} /* Literal.String.Regex */
.highlight .s1 {
  color: #c41a16;
} /* Literal.String.Single */
.highlight .ss {
  color: #c41a16;
} /* Literal.String.Symbol */
.highlight .bp {
  color: #5b269a;
} /* Name.Builtin.Pseudo */
.highlight .fm {
  color: #000000;
} /* Name.Function.Magic */
.highlight .vc {
  color: #000000;
} /* Name.Variable.Class */
.highlight .vg {
  color: #000000;
} /* Name.Variable.Global */
.highlight .vi {
  color: #000000;
} /* Name.Variable.Instance */
